# Maintainer: Ivan Semkin (ivan at semkin dot ru)

pkgname=location-service-git
_pkgname=location-service
pkgver=r951.142f6ca
pkgrel=2
pkgdesc='Location service aggregating position/velocity/heading updates and exporting them over dbus'
url='https://github.com/ubports/location-service'
arch=(x86_64 i686 armv7h aarch64)
license=(LGPL GPL)
conflicts=(location-service)
provides=(location-service)
depends=(boost net-cpp-git trust-store-git gtest gmock clang)
makedepends=(git cmake cmake-extras-git doxygen)
source=('git+https://github.com/ubports/location-service.git')
sha256sums=('SKIP')

#--   Package 'wpsapi', required by 'virtual:world', not found
BUILDENV+=('!check')

prepare() {
  cd ${_pkgname}
  git checkout bionic
}

pkgver() {
  cd ${_pkgname}
  echo "r$(git rev-list --count HEAD).$(git describe --always)"
}

build() {
  cd ${_pkgname}
  cmake -DLOCATION_SERVICE_ENABLE_GPS_PROVIDER=OFF -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_LIBDIR="lib/" -DCMAKE_INSTALL_LIBEXECDIR="lib/" .
  make
}

check() {
  cd ${_pkgname}
  make ARGS+="--output-on-failure" test
}

package() {
  cd ${_pkgname}
  make DESTDIR="${pkgdir}/" install
}
# vim:set ts=2 sw=2 et:
